<?php

namespace app\admin\middleware;

use think\response\Json;

class Base
{
    // 请求失败返回的json
    protected function requestFailReturn($message = '', $code = '') : Json
    {
        $code = empty($code) ? config('request.fail_code') : $code;
        return json([
            config('request.status_key')    =>  $code,
            config('request.message_key')   =>  $message
        ]);
    }
}